﻿/****************************************************************
*   作者：qq918
*   创建时间：2017/12/20 11:35:05
*   描述说明：
*   
*   版本文件说明
*****************************************************************/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LitJson;
using System.ComponentModel;

namespace Model
{
    
    /// <summary>
    /// 一个文件的信息
    /// </summary>
    public class FileVersionInfo
    {
        public string File;
        public string MD5;
        public long Size;
    }

    /// <summary>
    /// 一个版本信息配置
    /// </summary>
    public class VersionConfig : ISupportInitialize
    {
        public int Version;
        public long TotalSize;

        public List<FileVersionInfo> FileVersionInfos = new List<FileVersionInfo>();

        public Dictionary<string, FileVersionInfo> Dictionary = new Dictionary<string, FileVersionInfo>();

        public void BeginInit()
        {
            
        }

        public void EndInit()
        {
            this.Dictionary.Clear();
            this.TotalSize = 0;
            foreach (FileVersionInfo item in this.FileVersionInfos)
            {
                this.Dictionary.Add(item.File, item);
                this.TotalSize += item.Size;
            }
        }
    }
}
